<template>
	<view class="head">
		<image class="img" src="/static/activityList/left.png" mode=""></image>
		<view class="tab">
			<view class="item" :class="activeId == 1 ? 'active':''" @click="activeClick(1)">
				收到的
			</view>
			<view class="item" :class="activeId == 2 ? 'active':''" @click="activeClick(2)">
				送出的
			</view>
		</view>
	</view>
	<view class="content">
		<view class="list" v-for="(item, index) in list" key="item.id">
			<view class="item">
				<image src="" mode="" class="haedImg"></image>
				<view class="middle">
					<view class="name">
						{{ item.name }}
					</view>
					<view class="time">
						{{ item.time}}
					</view>
				</view>
				<view class="btn" v-if="activeId == 1">
					<image src="/static/exchange/btn.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	
	const activeId = ref('1')
	const list = ref([{
		head: '',
		name: '曹嘉怡',
		time: '2023-09-05 07:09',
		id: 1
	},{
		head: '',
		name: '任易轩',
		time: '2023-09-05 07:09',
		id: 2
	}])
	
	function activeClick(index){
		activeId.value = index
	}
</script>

<style lang="scss">
	.head{
		width: 100vw;
		height: 88rpx;
		display: flex;
		align-items: center;
		position: fixed;
		top: 0;
		left: 0;
		padding-right: 32rpx;
		box-sizing: border-box;
		font-size: 36rpx;
		color: #353535;
		background: #fff;
		z-index: 111;
		.img{
			width: 48rpx;
			height: 48rpx;
		}
		.tab{
			flex: 1;
			display: flex;
			align-items: center;
			justify-content: center;
			.item{
				padding: 0 20rpx;
				font-size: 36rpx;
				color: #999999;
			}
			.active{
				font-weight: 600;
				color: #000000;
			}
		}
	}
	.content{
		padding: 88rpx 34rpx;
		box-sizing: border-box;
		.item{
			height: 140rpx;
			border-bottom: 2rpx solid #F6F6F6;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.haedImg{
				width: 92rpx;
				height: 92rpx;
				margin-right: 20rpx;
				background: red;
				border-radius: 50%;
			}
			.btn{
				width: 152rpx;
				height: 60rpx;
				image{
					width: 100%;
					height: 100%;
				}
			}
			.middle{
				flex: 1;
				.time{
					font-size: 24rpx;
					color: #666666;
				}
			}
		}
	}
</style>